chrome.runtime.onMessage.addListener((message, sender, sendResponse) => {
    if (message.action === 'setSpeed') {
      document.querySelectorAll('video').forEach(video => {
        video.playbackRate = message.speed;
      });
    } else if (message.action === 'getSpeed') {
      const videos = document.querySelectorAll('video');
      if (videos.length > 0) {
        sendResponse({speed: videos[0].playbackRate});
      }
    }
    return true; // 异步响应
  });